package com.fowo.api.inventory.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;

/**
 * 入库库存服务实体
 * @author yl_ls
 */
@EqualsAndHashCode(callSuper = false)
@Data
@Schema(title = "入库库存服务实体")
public class InventoryStorageVo extends BaseInventoryItemVo {
    @Schema(title = "库位类型\n" +
            "    - Normal : 正常库存\n" +
            "    - Lock: 锁定库存\n"
    )
    private TargetTypeEnum fromBinIdsType;
    @Schema(title = "仓库内码")
    private Long stockId;
    //binIds: Map<库位内码, 入位数量>  可选，表示向指定库位入库
    @Schema(title = "binIds: Map<库位内码, 入位数量>  可选，表示向指定库位入库")
    private Map<Long,Integer> binIds;

    @Schema(title = "amount: 可选。入库金额（所有 qty 的成本）")
    private BigDecimal amount;

    @Schema(title = "to: 入库目标类型\n" +
              "    - Normal : 正常库存\n" +
            "    - Lock: 锁定库存\n" +
            "    - Display: 展示库存\n" +
            "    - Defect: 残次库存\n" +
            "    - Way: 在途库存")
    private TargetTypeEnum to;

    @Schema(title = "保质期（天）")
    private Integer shelfLife;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(title = "生存日期")
    private Date productionDate;

    @Schema(title = " 有效期至")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date expiryDate;

}
